// Author: wsfuyibing <682805@qq.com>
// Date: 2025-05-20

package save

import (
	"fmt"
	"server/app/kind"
	"strconv"
)

// Request
// 入参.
type Request struct {
	Id      int           `label:"原ID"`
	Enabled kind.Enabled  `label:"状态"`
	Kind    kind.PondKind `validate:"required,min=1" label:"鱼塘类型"`
	Seat    kind.PondSeat `validate:"required,min=1" label:"钓位类型"`
	Area    float64       `label:"鱼塘面积"`
	Depth   float64       `label:"鱼塘水深"`
	Name    string        `validate:"required,min=2,max=30" label:"鱼塘名称"`
}

func (o *Request) BeforeValidate() error {
	o.Depth, _ = strconv.ParseFloat(fmt.Sprintf(`%.01f`, o.Depth), 64)
	return nil
}
